import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        Ssan(1,2);
        Schang(1,2);
    }
    public static void Ssan(){
        Scanner reader = new Scanner(System.in);
        System.out.println("请输入三角形的高：");
        double a = reader.nextDouble();
        System.out.println("请输入三角形的底：");
        double b = reader.nextDouble();
        System.out.println("三角形的面积为："+(a*b)/2);
    }
    public static void Szheng(){
        Scanner reader = new Scanner(System.in);
        System.out.println("请输入正方形的边长：");
        double a = reader.nextDouble();
        System.out.println("正方形的面积为："+a*a);
    }
    public static void Schang(){
        Scanner reader = new Scanner(System.in);
        System.out.println("请输入长方形的高：");
        double a = reader.nextDouble();
        System.out.println("请输入长方形的宽：");
        double b = reader.nextDouble();
        System.out.println("长方形的面积为："+a*b);
    }
    public static void Ssan(double a ,double b){
        System.out.println("三角形的面积为："+(a*b)/2);
    }
    public static void Szheng(double a){
        System.out.println("正方形的面积为："+a*a);
    }
    public static void Schang(double a,double b){
        System.out.println("长方形的面积为："+a*b);
    }
    public static double Ssan(int x,int y) {
        System.out.println("三角形的面积为："+(x*y)/2);
        return (x*y)/2;
    }
    public static int Szheng(int x){
        System.out.println("正方形的面积为："+x*x);
        return (x*x);
    }
    public static int Schang(int x,int y) {
        System.out.println("长方形的面积为："+x*y);
        return (x * y);
    }
}

